package org.qloudgen.borg.pages.link;

import org.apache.wicket.Page;
import org.apache.wicket.markup.html.link.Link;
import org.qloudgen.borg.pages.frame.BodyFrame;

@SuppressWarnings({"rawtypes","unused"})
public final class ChangeFramePageLink extends Link
{
    private static final long serialVersionUID = 1L;

    private BodyFrame bodyFrame;

	private Class<? extends Page> pageClass;

    public <C extends Page> ChangeFramePageLink(String id, BodyFrame bodyFrame,
        Class<C> pageClass)
    {
        super(id);
        this.bodyFrame = bodyFrame;
        this.pageClass = pageClass;
    }

    @Override
    public void onClick()
    {
        // change frame class
//        bodyFrame.getFrameTarget().setFrameClass(pageClass);
        // trigger re-rendering of the page
        setResponsePage(bodyFrame);
    }

}
